﻿ 
using UnityEngine;
namespace DiIoc.ScriptableObjectDemo
{
    public class Sword : MonoBehaviour
    {
        [SerializeField]
        private SwardData swordData;
        [SerializeField]
        private GameEvents OnSwordSelected;

        private void Start()
        {
            GetComponent<SpriteRenderer>().sprite = swordData.Icon;
        }
        private void OnMouseDown() 
        {
            //Debug.Log(swordData.name); 
            //Debug.Log(swordData.Description); 
            //Debug.Log(swordData.Icon.name); 
            //Debug.Log(swordData.GoldCost); 
            //Debug.Log(swordData.AttackDamage); 
            OnSwordSelected.Raise();
        }
    }

}
